﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _404park.ApplicationServices.SearchProvider
{
    public class GoogleSearchProvider : ISearchProvider
    {
        public static readonly string GResultUrl = ConfigurationManager.AppSettings["googleSearchResultUrl"];

        public GoogleSearchProvider() : this(30)
        {
        }

        public GoogleSearchProvider(int percentage)
        {
            Percentage = percentage;
        }

        public string BaseUrl
        {
            get { return GResultUrl; }
        }

        public int Percentage { get;set; }

        public string Name { get { return "Google"; } }

        public string BuildNavigateUrl(string keywords)
        {
            return string.Format(BaseUrl, AppGlobal.AppHost, keywords, AppGlobal.AppHost);
        }
    }
}
